<template>
  <div>
     <home-header></home-header>
     <home-swiper></home-swiper>
     <home-banner></home-banner>
     <home-container :todata='todos'></home-container>
     <home-footer></home-footer>
  </div>
</template>

<script>
  import HomeHeader from './components/HomeHeader'
  import HomeSwiper from './components/HomeSwiper'
  import HomeBanner from './components/HomeBanner'
  import HomeContainer from './components/HomeContainer'
  import HomeFooter from '../footer/Footer'
  import axios from 'axios'
  export default{
    name: 'home',
    data() {
      return {
        todos: []
      }
    },
    components: {
      HomeHeader,
      HomeSwiper,
      HomeBanner,
      HomeContainer,
      HomeFooter
    },
    mounted() {
      this.getData()
    },
    // 模拟axios发送数据请求·
    methods: {
      getData: function(){
        var _this = this
        axios.get('/static/ceshi.json').then(function(res){
          // console.log(res);
          _this.todos = res.data.data.home
          console.log(_this.todos);
        })
      }
    },
  }
</script>

<style lang="less">
  *{
    box-sizing: border-box;
  }
</style>
